<template>
  <div class="box">
    <template v-if="to">
      <router-link :to="to"> <slot></slot></router-link>
      <span>{{ separator }}</span>
    </template>

    <template v-else>
      <slot></slot>
      <span>{{ separator }}</span>
    </template>
  </div>
</template>
<script>
export default {
  name: '',
  props: {
    to: {
      type: [String, Object]
    }
  },
  inject: ['separator'],
  data () {
    return {

    }
  },
  created () {
  },
  computed: {
  },
  methods: {
  }
}
</script>
<style lang='less'  scoped>
.box {
  &:last-child span {
    display: none;
  }
  span {
    margin: 0 5px;
  }
}

a {
  text-decoration: none;
}
</style>
